\(\int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx\) [1253]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 151 \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {5 a b \text {arctanh}(\cos (c+d x))}{64 d}-\frac {\left (a^2+b^2\right ) \cot ^7(c+d x)}{7 d}-\frac {a^2 \cot ^9(c+d x)}{9 d}+\frac {5 a b \cot (c+d x) \csc (c+d x)}{64 d}-\frac {5 a b \cot (c+d x) \csc ^3(c+d x)}{32 d}+\frac {5 a b \cot ^3(c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d} \]

[Out]

5/64*a*b*arctanh(cos(d*x+c))/d-1/7*(a^2+b^2)*cot(d*x+c)^7/d-1/9*a^2*cot(d*x+c)^9/d+5/64*a*b*cot(d*x+c)*csc(d*x
+c)/d-5/32*a*b*cot(d*x+c)*csc(d*x+c)^3/d+5/24*a*b*cot(d*x+c)^3*csc(d*x+c)^3/d-1/4*a*b*cot(d*x+c)^5*csc(d*x+c)^
3/d

Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {2990, 2691, 3853, 3855, 14} \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {\left (a^2+b^2\right ) \cot ^7(c+d x)}{7 d}-\frac {a^2 \cot ^9(c+d x)}{9 d}+\frac {5 a b \text {arctanh}(\cos (c+d x))}{64 d}-\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d}+\frac {5 a b \cot ^3(c+d x) \csc ^3(c+d x)}{24 d}-\frac {5 a b \cot (c+d x) \csc ^3(c+d x)}{32 d}+\frac {5 a b \cot (c+d x) \csc (c+d x)}{64 d} \]

[In]

Int[Cot[c + d*x]^6*Csc[c + d*x]^4*(a + b*Sin[c + d*x])^2,x]

[Out]

(5*a*b*ArcTanh[Cos[c + d*x]])/(64*d) - ((a^2 + b^2)*Cot[c + d*x]^7)/(7*d) - (a^2*Cot[c + d*x]^9)/(9*d) + (5*a*
b*Cot[c + d*x]*Csc[c + d*x])/(64*d) - (5*a*b*Cot[c + d*x]*Csc[c + d*x]^3)/(32*d) + (5*a*b*Cot[c + d*x]^3*Csc[c
 + d*x]^3)/(24*d) - (a*b*Cot[c + d*x]^5*Csc[c + d*x]^3)/(4*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2990

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^2, x_Symbol] :> Dist[2*a*(b/d), Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e
+ f*x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && NeQ[a^2 -
 b^2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = (2 a b) \int \cot ^6(c+d x) \csc ^3(c+d x) \, dx+\int \cot ^6(c+d x) \csc ^4(c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right ) \, dx \\ & = -\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{4} (5 a b) \int \cot ^4(c+d x) \csc ^3(c+d x) \, dx+\frac {\text {Subst}\left (\int \frac {a^2+\left (a^2+b^2\right ) x^2}{x^{10}} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {5 a b \cot ^3(c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d}+\frac {1}{8} (5 a b) \int \cot ^2(c+d x) \csc ^3(c+d x) \, dx+\frac {\text {Subst}\left (\int \left (\frac {a^2}{x^{10}}+\frac {a^2+b^2}{x^8}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = -\frac {\left (a^2+b^2\right ) \cot ^7(c+d x)}{7 d}-\frac {a^2 \cot ^9(c+d x)}{9 d}-\frac {5 a b \cot (c+d x) \csc ^3(c+d x)}{32 d}+\frac {5 a b \cot ^3(c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{32} (5 a b) \int \csc ^3(c+d x) \, dx \\ & = -\frac {\left (a^2+b^2\right ) \cot ^7(c+d x)}{7 d}-\frac {a^2 \cot ^9(c+d x)}{9 d}+\frac {5 a b \cot (c+d x) \csc (c+d x)}{64 d}-\frac {5 a b \cot (c+d x) \csc ^3(c+d x)}{32 d}+\frac {5 a b \cot ^3(c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{64} (5 a b) \int \csc (c+d x) \, dx \\ & = \frac {5 a b \text {arctanh}(\cos (c+d x))}{64 d}-\frac {\left (a^2+b^2\right ) \cot ^7(c+d x)}{7 d}-\frac {a^2 \cot ^9(c+d x)}{9 d}+\frac {5 a b \cot (c+d x) \csc (c+d x)}{64 d}-\frac {5 a b \cot (c+d x) \csc ^3(c+d x)}{32 d}+\frac {5 a b \cot ^3(c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot ^5(c+d x) \csc ^3(c+d x)}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.62 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.35 \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {-40320 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+40320 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\csc ^9(c+d x) \left (4032 \left (8 a^2+b^2\right ) \cos (c+d x)+18816 a^2 \cos (3 (c+d x))+5760 a^2 \cos (5 (c+d x))-2304 b^2 \cos (5 (c+d x))+576 a^2 \cos (7 (c+d x))-1440 b^2 \cos (7 (c+d x))-64 a^2 \cos (9 (c+d x))-288 b^2 \cos (9 (c+d x))+18270 a b \sin (2 (c+d x))+10458 a b \sin (4 (c+d x))+8022 a b \sin (6 (c+d x))+315 a b \sin (8 (c+d x))\right )}{516096 d} \]

[In]

Integrate[Cot[c + d*x]^6*Csc[c + d*x]^4*(a + b*Sin[c + d*x])^2,x]

[Out]

-1/516096*(-40320*a*b*Log[Cos[(c + d*x)/2]] + 40320*a*b*Log[Sin[(c + d*x)/2]] + Csc[c + d*x]^9*(4032*(8*a^2 +
b^2)*Cos[c + d*x] + 18816*a^2*Cos[3*(c + d*x)] + 5760*a^2*Cos[5*(c + d*x)] - 2304*b^2*Cos[5*(c + d*x)] + 576*a
^2*Cos[7*(c + d*x)] - 1440*b^2*Cos[7*(c + d*x)] - 64*a^2*Cos[9*(c + d*x)] - 288*b^2*Cos[9*(c + d*x)] + 18270*a
*b*Sin[2*(c + d*x)] + 10458*a*b*Sin[4*(c + d*x)] + 8022*a*b*Sin[6*(c + d*x)] + 315*a*b*Sin[8*(c + d*x)]))/d

Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.26

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{9 \sin \left (d x +c \right )^{9}}-\frac {2 \left (\cos ^{7}\left (d x +c \right )\right )}{63 \sin \left (d x +c \right )^{7}}\right )+2 a b \left (-\frac {\cos ^{7}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{8}}-\frac {\cos ^{7}\left (d x +c \right )}{48 \sin \left (d x +c \right )^{6}}+\frac {\cos ^{7}\left (d x +c \right )}{192 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{7}\left (d x +c \right )}{128 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{128}-\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{384}-\frac {5 \cos \left (d x +c \right )}{128}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{128}\right )-\frac {b^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{7 \sin \left (d x +c \right )^{7}}}{d}\) \(191\)
default \(\frac {a^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{9 \sin \left (d x +c \right )^{9}}-\frac {2 \left (\cos ^{7}\left (d x +c \right )\right )}{63 \sin \left (d x +c \right )^{7}}\right )+2 a b \left (-\frac {\cos ^{7}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{8}}-\frac {\cos ^{7}\left (d x +c \right )}{48 \sin \left (d x +c \right )^{6}}+\frac {\cos ^{7}\left (d x +c \right )}{192 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{7}\left (d x +c \right )}{128 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{128}-\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{384}-\frac {5 \cos \left (d x +c \right )}{128}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{128}\right )-\frac {b^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{7 \sin \left (d x +c \right )^{7}}}{d}\) \(191\)
parallelrisch \(\frac {63 a b \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-72 b^{2} \left (\cot ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+336 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}+504 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -5040 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +54 a^{2} \left (\cot ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+756 a^{2} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-756 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2}-2520 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}+2520 b^{2} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-504 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-1512 b^{2} \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-14 a^{2} \left (\cot ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-336 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -1008 a b \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+72 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-336 a^{2} \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+14 \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}-54 a^{2} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+504 b^{2} \left (\cot ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-63 a b \left (\cot ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1512 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-504 a b \left (\cot ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1008 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +336 a b \left (\cot ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64512 d}\) \(389\)
risch \(-\frac {-128 i a^{2}-576 i b^{2}+3456 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-12672 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+1152 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-315 a b \,{\mathrm e}^{i \left (d x +c \right )}-32256 i b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+24192 i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+24192 i b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-18270 a b \,{\mathrm e}^{7 i \left (d x +c \right )}+1152 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-8022 a b \,{\mathrm e}^{3 i \left (d x +c \right )}+24192 i a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-4032 i b^{2} {\mathrm e}^{16 i \left (d x +c \right )}+40320 i a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+13440 i a^{2} {\mathrm e}^{12 i \left (d x +c \right )}+10458 a b \,{\mathrm e}^{13 i \left (d x +c \right )}+18270 a b \,{\mathrm e}^{11 i \left (d x +c \right )}-24192 i b^{2} {\mathrm e}^{12 i \left (d x +c \right )}-10458 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+40320 i b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+315 a b \,{\mathrm e}^{17 i \left (d x +c \right )}+8064 i a^{2} {\mathrm e}^{14 i \left (d x +c \right )}+8064 i b^{2} {\mathrm e}^{14 i \left (d x +c \right )}+8022 a b \,{\mathrm e}^{15 i \left (d x +c \right )}}{2016 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{9}}-\frac {5 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{64 d}+\frac {5 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{64 d}\) \(400\)

[In]

int(cos(d*x+c)^6*csc(d*x+c)^10*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(-1/9/sin(d*x+c)^9*cos(d*x+c)^7-2/63/sin(d*x+c)^7*cos(d*x+c)^7)+2*a*b*(-1/8/sin(d*x+c)^8*cos(d*x+c)^7
-1/48/sin(d*x+c)^6*cos(d*x+c)^7+1/192/sin(d*x+c)^4*cos(d*x+c)^7-1/128/sin(d*x+c)^2*cos(d*x+c)^7-1/128*cos(d*x+
c)^5-5/384*cos(d*x+c)^3-5/128*cos(d*x+c)-5/128*ln(csc(d*x+c)-cot(d*x+c)))-1/7*b^2/sin(d*x+c)^7*cos(d*x+c)^7)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 291 vs. \(2 (137) = 274\).

Time = 0.39 (sec) , antiderivative size = 291, normalized size of antiderivative = 1.93 \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {128 \, {\left (2 \, a^{2} + 9 \, b^{2}\right )} \cos \left (d x + c\right )^{9} - 1152 \, {\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{7} + 315 \, {\left (a b \cos \left (d x + c\right )^{8} - 4 \, a b \cos \left (d x + c\right )^{6} + 6 \, a b \cos \left (d x + c\right )^{4} - 4 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 315 \, {\left (a b \cos \left (d x + c\right )^{8} - 4 \, a b \cos \left (d x + c\right )^{6} + 6 \, a b \cos \left (d x + c\right )^{4} - 4 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 42 \, {\left (15 \, a b \cos \left (d x + c\right )^{7} + 73 \, a b \cos \left (d x + c\right )^{5} - 55 \, a b \cos \left (d x + c\right )^{3} + 15 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8064 \, {\left (d \cos \left (d x + c\right )^{8} - 4 \, d \cos \left (d x + c\right )^{6} + 6 \, d \cos \left (d x + c\right )^{4} - 4 \, d \cos \left (d x + c\right )^{2} + d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^10*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/8064*(128*(2*a^2 + 9*b^2)*cos(d*x + c)^9 - 1152*(a^2 + b^2)*cos(d*x + c)^7 + 315*(a*b*cos(d*x + c)^8 - 4*a*b
*cos(d*x + c)^6 + 6*a*b*cos(d*x + c)^4 - 4*a*b*cos(d*x + c)^2 + a*b)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c)
- 315*(a*b*cos(d*x + c)^8 - 4*a*b*cos(d*x + c)^6 + 6*a*b*cos(d*x + c)^4 - 4*a*b*cos(d*x + c)^2 + a*b)*log(-1/2
*cos(d*x + c) + 1/2)*sin(d*x + c) - 42*(15*a*b*cos(d*x + c)^7 + 73*a*b*cos(d*x + c)^5 - 55*a*b*cos(d*x + c)^3
+ 15*a*b*cos(d*x + c))*sin(d*x + c))/((d*cos(d*x + c)^8 - 4*d*cos(d*x + c)^6 + 6*d*cos(d*x + c)^4 - 4*d*cos(d*
x + c)^2 + d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**6*csc(d*x+c)**10*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.02 \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {21 \, a b {\left (\frac {2 \, {\left (15 \, \cos \left (d x + c\right )^{7} + 73 \, \cos \left (d x + c\right )^{5} - 55 \, \cos \left (d x + c\right )^{3} + 15 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{8} - 4 \, \cos \left (d x + c\right )^{6} + 6 \, \cos \left (d x + c\right )^{4} - 4 \, \cos \left (d x + c\right )^{2} + 1} - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {1152 \, b^{2}}{\tan \left (d x + c\right )^{7}} + \frac {128 \, {\left (9 \, \tan \left (d x + c\right )^{2} + 7\right )} a^{2}}{\tan \left (d x + c\right )^{9}}}{8064 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^10*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/8064*(21*a*b*(2*(15*cos(d*x + c)^7 + 73*cos(d*x + c)^5 - 55*cos(d*x + c)^3 + 15*cos(d*x + c))/(cos(d*x + c)
^8 - 4*cos(d*x + c)^6 + 6*cos(d*x + c)^4 - 4*cos(d*x + c)^2 + 1) - 15*log(cos(d*x + c) + 1) + 15*log(cos(d*x +
 c) - 1)) + 1152*b^2/tan(d*x + c)^7 + 128*(9*tan(d*x + c)^2 + 7)*a^2/tan(d*x + c)^9)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 408 vs. \(2 (137) = 274\).

Time = 0.44 (sec) , antiderivative size = 408, normalized size of antiderivative = 2.70 \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {14 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 63 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 54 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 72 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 336 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 504 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 504 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 336 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1512 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1008 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 5040 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 756 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2520 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {14258 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 756 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 2520 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 1008 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 336 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 1512 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 504 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 504 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 336 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 54 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 72 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 63 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 14 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9}}}{64512 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^10*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/64512*(14*a^2*tan(1/2*d*x + 1/2*c)^9 + 63*a*b*tan(1/2*d*x + 1/2*c)^8 - 54*a^2*tan(1/2*d*x + 1/2*c)^7 + 72*b^
2*tan(1/2*d*x + 1/2*c)^7 - 336*a*b*tan(1/2*d*x + 1/2*c)^6 - 504*b^2*tan(1/2*d*x + 1/2*c)^5 + 504*a*b*tan(1/2*d
*x + 1/2*c)^4 + 336*a^2*tan(1/2*d*x + 1/2*c)^3 + 1512*b^2*tan(1/2*d*x + 1/2*c)^3 + 1008*a*b*tan(1/2*d*x + 1/2*
c)^2 - 5040*a*b*log(abs(tan(1/2*d*x + 1/2*c))) - 756*a^2*tan(1/2*d*x + 1/2*c) - 2520*b^2*tan(1/2*d*x + 1/2*c)
+ (14258*a*b*tan(1/2*d*x + 1/2*c)^9 + 756*a^2*tan(1/2*d*x + 1/2*c)^8 + 2520*b^2*tan(1/2*d*x + 1/2*c)^8 - 1008*
a*b*tan(1/2*d*x + 1/2*c)^7 - 336*a^2*tan(1/2*d*x + 1/2*c)^6 - 1512*b^2*tan(1/2*d*x + 1/2*c)^6 - 504*a*b*tan(1/
2*d*x + 1/2*c)^5 + 504*b^2*tan(1/2*d*x + 1/2*c)^4 + 336*a*b*tan(1/2*d*x + 1/2*c)^3 + 54*a^2*tan(1/2*d*x + 1/2*
c)^2 - 72*b^2*tan(1/2*d*x + 1/2*c)^2 - 63*a*b*tan(1/2*d*x + 1/2*c) - 14*a^2)/tan(1/2*d*x + 1/2*c)^9)/d

Mupad [B] (verification not implemented)

Time = 11.79 (sec) , antiderivative size = 373, normalized size of antiderivative = 2.47 \[ \int \cot ^6(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{4608\,d}-\frac {b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{128\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a^2}{256}+\frac {5\,b^2}{128}\right )}{d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {8\,a^2}{3}+12\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {3\,a^2}{7}-\frac {4\,b^2}{7}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (6\,a^2+20\,b^2\right )-4\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\frac {a^2}{9}-\frac {8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}\right )}{512\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {a^2}{192}+\frac {3\,b^2}{128}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {3\,a^2}{3584}-\frac {b^2}{896}\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{64\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{128\,d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{192\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{1024\,d}-\frac {5\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{64\,d} \]

[In]

int((cos(c + d*x)^6*(a + b*sin(c + d*x))^2)/sin(c + d*x)^10,x)

[Out]

(a^2*tan(c/2 + (d*x)/2)^9)/(4608*d) - (b^2*tan(c/2 + (d*x)/2)^5)/(128*d) - (tan(c/2 + (d*x)/2)*((3*a^2)/256 +
(5*b^2)/128))/d - (cot(c/2 + (d*x)/2)^9*(tan(c/2 + (d*x)/2)^6*((8*a^2)/3 + 12*b^2) - tan(c/2 + (d*x)/2)^2*((3*
a^2)/7 - (4*b^2)/7) - tan(c/2 + (d*x)/2)^8*(6*a^2 + 20*b^2) - 4*b^2*tan(c/2 + (d*x)/2)^4 + a^2/9 - (8*a*b*tan(
c/2 + (d*x)/2)^3)/3 + 4*a*b*tan(c/2 + (d*x)/2)^5 + 8*a*b*tan(c/2 + (d*x)/2)^7 + (a*b*tan(c/2 + (d*x)/2))/2))/(
512*d) + (tan(c/2 + (d*x)/2)^3*(a^2/192 + (3*b^2)/128))/d - (tan(c/2 + (d*x)/2)^7*((3*a^2)/3584 - b^2/896))/d
+ (a*b*tan(c/2 + (d*x)/2)^2)/(64*d) + (a*b*tan(c/2 + (d*x)/2)^4)/(128*d) - (a*b*tan(c/2 + (d*x)/2)^6)/(192*d)
+ (a*b*tan(c/2 + (d*x)/2)^8)/(1024*d) - (5*a*b*log(tan(c/2 + (d*x)/2)))/(64*d)